home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / pcr / pcr4_4.lha / DIST / dylibload / INCLUDE / xr / libsearch.h next >
C/C++ Source or Header  |  1989-09-20  |  2KB  |  73 lines

  1. /*
  2.  *      %M% %I% of %G%
  3.  *      %W%
  4.  */
  5. /* begincopyright
  6.   Copyright (c) 1988 Xerox Corporation. All rights reserved.
  7.   Use and copying of this software and preparation of derivative works based
  8.   upon this software are permitted. Any distribution of this software or
  9.   derivative works must comply with all applicable United States export
  10.   control laws. This software is made available AS IS, and Xerox Corporation
  11.   makes no warranty about the software, its performance or its conformity to
  12.   any specification. Any person obtaining a copy of this software is requested
  13.   to send their name and post office or electronic mail address to:
  14.     PCR Coordinator
  15.     Xerox PARC
  16.     3333 Coyote Hill Rd.
  17.     Palo Alto, CA
  18.   endcopyright */
  19.  
  20. /*
  21.  * register pcr commands to manipulate the library list
  22.  *    libdefault - set library list to the default list
  23.  *    libpop - pop up the stack of library lists
  24.  *    libpush - push down the stack of library lists
  25.  *    libclear - clear the library list
  26.  *    liblist -  list the libraries on the library list
  27.  *    libappend - append the argument to the end of the library list
  28.  *    libprepend - prepend the argument to the beginning of the library list
  29.  *    libclose - close all libraries to release file descriptors.
  30.  *
  31.  * and initialize the library list to the following:
  32.  *    /usr/lib/libc.a /usr/lib/libm.a /usr/lib/libpixrect.a
  33.  */
  34.  
  35. void
  36. XR_lib_init();
  37.  
  38.  
  39. /*
  40.  * given an undefined symbol (sym), look it up in the library list,
  41.  * return true, 
  42.  *    (libfd) a file descriptor for the library,
  43.  *    (liboffset) an offset at which begins the library member defining the symbol,
  44.  *            i.e. lseek to liboffset to read a.out header,
  45.  *    (magic) a hint on the type of the library,
  46.  * and    (modulename) the string "<name of the library>(<name of library member>)".
  47.  * return false if symbol is not found in any library in the library list.
  48.  */
  49.  
  50. bool
  51. XR_lib_symfind(/*
  52.     char *sym,
  53.     XR_Fildes *libfd,
  54.     long *liboffset,
  55.     long *magic,
  56.     char **modulename    */);
  57.  
  58.  
  59. /*
  60.  * private, implementation details
  61.  */
  62.  
  63. struct library {
  64.   char *libname;        /* name of the library */
  65.   XR_Fildes fildes;        /* if not -1, file descriptor of opened library */
  66.   struct ranlib *ranp;        /* pointer to array of struct ranlib's in _SYMDEF */
  67.   struct ranlib *ranpMax;    /* pointer to end of struct ranlib array */
  68.   char *strp;            /* pointer to string table in _SYMDEF */
  69. };
  70.  
  71. #define MAX_UNDEFINEDS 1500
  72. #define LIB_LIST_STACK_MAX_DEPTH 3
  73.